
function loadJson(filepath,callback)
{
var xmlhttp;
if (window.XMLHttpRequest)
  {// code for IE7+, Firefox, Chrome, Opera, Safari
  xmlhttp=new XMLHttpRequest();
  }
else
  {// code for IE6, IE5
  xmlhttp=new ActiveXObject("Microsoft.XMLHTTP");
  }
xmlhttp.onreadystatechange=function()
  {
  if (xmlhttp.readyState==4 && xmlhttp.status==200)
    {
     var JSON_object = JSON.parse(xmlhttp.responseText);
     document.getElementById("myDiv").innerHTML=xmlhttp.responseText;
  callback(JSON_object); 
    }
  }
xmlhttp.open("GET",filepath,true);

xmlhttp.send();
}

function getweight(){

var filepath="wieght.json";
var JSON_object = loadJson(filepath, function(JSON_object){
 var weight=JSON_object.result.WEIGHTDATALIST.WeightValue;
   alert (weight);});

}

function getBOxygen(){

var filepath= "BOxygen.json";
var JSON_object = loadJson(filepath, function(JSON_object){
 var oxygen=JSON_object.result.BODATALIST.BO;
   alert (oxygen);
   });

}


function getBpressure(){

var filepath="Bpressure.json";
var JSON_object = loadJson(filepath, function(JSON_object){
 var HP=JSON_object.result.BPDATALIST.HP;
 var LP=JSON_object.result.BPDATALIST.LP;
   alert (HP + LP);});
}

function getactivity(){
var filepath= "activityreport.json";
var JSON_object = loadJson(filepath, function(JSON_object){
 var activity=JSON_object.result.ARDATALIST.Calories;
   alert (activity);});

}

function getpatient(){
var filepath= "patient8.json";
var JSON_object = loadJson(filepath, function(JSON_object){
 var activity=JSON_object;
   //alert (activity);
   });

}
